home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
17 Bit Software 6: Level 6
/
17 Bit - Level 6 (1998)(Epic Marketing)[!].iso
/
quartz
/
q0052.dms
/
q0052.adf
/
SOURCES
/
NPReplayV1.00II.S
< prev
next >
Wrap
Text File
|
1991-06-28
|
6KB
|
326 lines
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* NoisePacker V1.0 PlayRoutine ©1990 Twins of Phenomena. *
* You must always have $dff000 in a5 to use this routine. *
* Used registers are d0-d6/a0-a4/a6. It use lev6irq. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
m_data: equ $60000
m_init: lea m_data,a4
lea m_position(pc),a6
moveq #2,d0
moveq #0,d1
move.l a4,a3
m_init1:add (a4)+,a3
move.l a3,(a6)+
dbf d0,m_init1
move (a4)+,d0
add.l d0,a3
move.l $78.w,(a6)+
move.l #$00060100,(a6)+
move.l d1,(a6)+
move d1,(a6)+
move.l a4,a6
add -8(a4),a6
sub #12,a6
m_init2:move.l a3,(a4)
move.l a3,a2
add 14(a4),a2
move.l a2,8(a4)
move 4(a4),d0
lsl #1,d0
add d0,a3
add #16,a4
cmp.l a4,a6
bne.s m_init2
bset #1,$bfe001
move d1,$a8(a5)
move d1,$b8(a5)
move d1,$c8(a5)
move d1,$d8(a5)
lea $bfd000,a0
move.b #$7f,$d00(a0)
move.b d1,$e00(a0)
move.b #$ef,$400(a0)
move.b d1,$500(a0)
move.b #$81,$d00(a0)
move #$2000,$9c(a5)
move #$a000,$9a(a5)
rts
m_end: moveq #0,d0
move d0,$a8(a5)
move d0,$b8(a5)
move d0,$c8(a5)
move d0,$d8(a5)
move #$f,$96(a5)
move #$2000,$9a(a5)
move.l m_oldirq(pc),$78.w
rts
m_music:moveq #0,d6
lea $d0(a5),a4
lea m_block(pc),a6
addq.b #1,(a6)
move.b (a6),d0
cmp.b 1(a6),d0
bne m_nonew
move.b d6,(a6)
move.l m_position(pc),a0
move 6(a6),d0
move (a0,d0),d0
move.l m_pattern(pc),a0
add d0,a0
move.l m_voice(pc),a1
add 8(a6),a1
lea m_voidat1(pc),a2
moveq #8,d0
moveq #0,d4
moveq #0,d5
m_loop1:moveq #0,d2
moveq #0,d1
move (a0)+,d1
lea (a1,d1.l),a3
moveq #0,d1
move.b (a3)+,d1
move.b (a3)+,d3
move.b (a3)+,d4
bclr #0,d1
beq.s m_loop2
moveq #$10,d2
m_loop2:tst.b d1
beq.s m_loop4
move.b d1,(a2)
move m_periods-2(pc,d1.w),d1
or d0,d5
move d1,6(a4)
move d1,24(a2)
move.b d6,5(a2)
move.b d3,d1
lsr.b #4,d1
or.b d1,d2
bne.s m_loop3
move.b 1(a2),d2
lea m_data-8,a3
lsl #4,d2
add d2,a3
move.l (a3)+,(a4)
move (a3)+,4(a4)
addq #2,a3
move.l (a3)+,48(a2)
move (a3)+,52(a2)
bra.s m_loop4
m_loop3:move.b d2,1(a2)
lea m_data-8,a3
lsl #4,d2
add d2,a3
move.l (a3)+,(a4)
move (a3)+,4(a4)
move (a3)+,26(a2)
move.l (a3)+,48(a2)
move (a3)+,52(a2)
m_loop4:and #$f,d3
move.b d3,2(a2)
move.b d4,3(a2)
cmp.b #$c,d3
bne m_loop5
move d4,26(a2)
bra m_loop8
m_periods:
dc.w $0358,$0328,$02fa,$02d0,$02a6,$0280,$025c,$023a,$021a
dc.w $01fc,$01e0,$01c5,$01ac,$0194,$017d,$0168,$0153,$0140
dc.w $012e,$011d,$010d,$00fe,$00f0,$00e2,$00d6,$00ca,$00be
dc.w $00b4,$00aa,$00a0,$0097,$008f,$0087,$007f,$0078,$0071
m_arp: moveq #0,d2
move.b (a6),d2
move.b m_arplist(pc,d2.w),d2
beq.s m_arp0
cmp.b #2,d2
beq.s m_arp2
m_arp1: move.b 3(a0),d2
lsr #3,d2
and #$e,d2
bra.s m_arp3
m_arp2: move.b 3(a0),d2
and #$f,d2
lsl #1,d2
m_arp3: moveq #0,d3
move.b (a0),d3
add d2,d3
cmp #$48,d3
bls.s m_arp4
moveq #$48,d3
m_arp4: move m_periods-2(pc,d3.w),6(a4)
bra m_lop3
m_arp0: move 24(a0),6(a4)
bra m_lop3
m_arplist:
dc.b 0,1,2,0,1,2,0,1,2,0,1,2,0,1,2,0,1,2,0,1,2,0,1,2,0,1,2,0,1,2,0,1
m_loop5:cmp.b #$d,d3
bne.s m_loop6
move d6,2(a6)
bra.s m_loop8
m_loop6:cmp.b #$b,d3
bne.s m_loop7
move d6,2(a6)
lsl #1,d4
subq #2,d4
move d4,6(a6)
bra.s m_loop8
m_loop7:cmp.b #$f,d3
bne.s m_loop8
move.b d4,1(a6)
m_loop8:move 26(a2),8(a4)
addq #6,a2
sub #$10,a4
lsr #1,d0
bne m_loop1
move d5,$dff096
or #$8000,d5
move d5,4(a6)
move.l #m_irq1,$78.w
move.b #$19,$bfde00
move.l m_position(pc),a0
bset #0,2(a6)
beq.s m_break
addq #3,8(a6)
cmp #192,8(a6)
bne.s m_next
m_break:move d6,8(a6)
addq #2,6(a6)
move 6(a6),d0
cmp -4(a0),d0
bne.s m_next
move -2(a0),6(a6)
m_next: rts
m_nonew:lea m_voidat1(pc),a0
moveq #3,d0
m_lop1: move.b 2(a0),d1
bne.s m_lop2
tst.b 3(a0)
bne m_arp
m_lop2: cmp.b #$1,d1
beq.s m_portup
cmp.b #$2,d1
beq.s m_portdown
cmp.b #$4,d1
beq.s m_vib
cmp.b #$6,d1
beq.s m_vib2
cmp.b #$a,d1
beq m_volslide
m_lop3: addq #6,a0
sub #$10,a4
dbf d0,m_lop1
rts
m_portup:
moveq #0,d2
move.b 3(a0),d2
sub d2,24(a0)
cmp #$71,24(a0)
bpl.s m_portup2
move #$71,24(a0)
m_portup2:
move 24(a0),6(a4)
bra.s m_lop3
m_portdown:
moveq #0,d2
move.b 3(a0),d2
add d2,24(a0)
cmp #$358,24(a0)
bmi.s m_portdown2
move #$358,24(a0)
m_portdown2:
move 24(a0),6(a4)
bra.s m_lop3
m_sin:
dc.b $00,$18,$31,$4a,$61,$78,$8d,$a1,$b4,$c5,$d4,$e0,$eb,$f4,$fa,$fd
dc.b $ff,$fd,$fa,$f4,$eb,$e0,$d4,$c5,$b4,$a1,$8d,$78,$61,$4a,$31,$18
m_vib: move.b 3(a0),d3
beq.s m_vib2
move.b d3,4(a0)
m_vib2: move.b 5(a0),d3
lsr #2,d3
and #$1f,d3
moveq #0,d2
move.b m_sin(pc,d3.w),d2
move.b 4(a0),d3
and #$f,d3
mulu d3,d2
lsr #7,d2
move 24(a0),d3
tst.b 5(a0)
bmi.s m_vibsub
add d2,d3
bra.s m_vib3
m_vibsub:
sub d2,d3
m_vib3: move d3,6(a4)
move.b 4(a0),d3
lsr #2,d3
and #$3c,d3
add.b d3,5(a0)
cmp.b #$6,d1
beq.s m_volslide
bra m_lop3
m_volslide:
move.b 3(a0),d2
add.b d2,27(a0)
bmi.s m_vol3
cmp.b #$40,27(a0)
bmi.s m_vol2
move #$40,26(a0)
m_vol2: move 26(a0),8(a4)
bra m_lop3
m_vol3: move d6,26(a0)
move 26(a0),8(a4)
bra m_lop3
m_irq1: tst.b $bfdd00
move.b #$19,$bfde00
move.l #m_irq2,$78.w
move m_block+4(pc),$96(a5)
move #$2000,$9c(a5)
rte
m_irq2: tst.b $bfdd00
move.l a6,-(sp)
lea m_voidat2(pc),a6
move.l (a6)+,$d0(a5)
move (a6)+,$d4(a5)
move.l (a6)+,$c0(a5)
move (a6)+,$c4(a5)
move.l (a6)+,$b0(a5)
move (a6)+,$b4(a5)
move.l (a6)+,$a0(a5)
move (a6)+,$a4(a5)
move #$2000,$9c(a5)
move.l (sp)+,a6
rte
m_position: dc.l 0
m_pattern: dc.l 0
m_voice: dc.l 0
m_oldirq: dc.l 0
m_block: blk.w 5,0
m_voidat1: blk.l 12,0
m_voidat2: blk.l 6,0